<%@ page import="java.util.Enumeration" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isErrorPage="true" %>



<html>
<head>
    <title>Title</title>
</head>
<body>


<%
    //四个域中分别设置值
    pageContext.setAttribute("pkey", "pvalue");
    request.setAttribute("rkey", "rvalue");
    session.setAttribute("skey", "svalue");
    application.setAttribute("akey", "avalue");

    //用一个对象取四个域中得到值
    pageContext.getAttribute("pkey", 1);
    pageContext.getAttribute("rkey", 1);
    pageContext.getAttribute("rkey", 1);
    pageContext.getAttribute("rkey", 1);

    //查询指定key,查找顺序是 pageContext->request->session->application找到哪里有就返回哪个域的
    pageContext.findAttribute("rkey");

    //删除域对象中的值,都删!!!哪个域里有删哪个!!!
    pageContext.removeAttribute("rkey");

%>
</body>
</html>
